<script setup lang="ts">
import { baseUrl } from '@/config'
defineProps({
  src: {
    type: String,
    default: ''
  },
  index: {
    type: Number,
    default: 0
  },
  shape: {
    type: String,
    default: 'square'
  },
  mode: {
    type: String,
    default: 'aspectFill'
  },
  customStyle: {
    type: Object,
    default: () => {
      return {
        width: '300rpx',
        height: '300rpx'
      }
    }
  }
})
</script>

<template>
  <uv-image :customStyle="customStyle" :shape="shape" :key="index" :src="src ? baseUrl + src : ''"></uv-image>
</template>

<style lang="scss">
::v-deep .uv-image__error {
  width: 100% !important;
  height: 100% !important;
}

::v-deep .uv-image__loading {
  width: 100% !important;
  height: 100% !important;
}
</style>
